<template>
    <div class="film" v-if="film">
        <filmheader :film="film"></filmheader>
        <filmcontent :actors="film.actors"></filmcontent>
        <filmfooter @openalbum="open_album" :photos="film.photos"></filmfooter>
        <album ref="album" :photos="film.photos"></album>
        <!-- <mypreview ref="mypreview"></mypreview> -->
    </div>
</template>

<script>
import axios from 'axios';
import filmcontent from './components/filmcontent.vue';
import filmheader from './components/filmheader.vue';
import filmfooter from './components/filmfooter.vue';
import Album from '../album.vue';
import Mypreview from '@/components/Mypreview.vue';

export default {
    data() {
        return {
            film: null,
        }
    }, methods: {
        open_album() {
            this.$refs.album.album_isshow()
        },
        getfilmdetail() {
            axios.get(`https://m.maizuo.com/gateway?filmId=${this.$route.params.filmid}&k=8722307`, {
                headers: {
                    'X-Host': 'mall.film-ticket.film.info'
                }
            })
                .then(res => res.data)
                .then(res => {
                    this.film = res.data.film
                })
        }
    },
    created() {
        this.getfilmdetail()
    },
    components: {
        filmheader,
        filmcontent,
        filmfooter,
        Album,
        Mypreview
    }
}
</script>

<style lang="less" scoped>
@import url(@/assets/Less/common.less);
</style>